package com.lanou3g.code0426;

import java.sql.SQLException;
import java.sql.Statement;

/**
 * Created by dllo on 18/4/26.
 */
public class Test03 {
    public static void main(String[] args) {
        String sql ="DELETE FROM  stu WHERE Sname ='张三'";
        Statement statement=JDBCUtil.getStatement();
        try {
         int rows = statement.executeUpdate(sql);
            if (rows>0){
                System.out.println("成功");
            }else {
                System.out.println("失败");
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }JDBCUtil.closeResource(statement);
        JDBCUtil.closConn();//放在Main 方法的最后一行
        //整个项目写一遍就可以了,别写太多,千万别写太多
    }
}
